package com.distributeredis.redis_springboot.springaop.controller;

import com.alibaba.fastjson.JSON;
import com.distributeredis.redis_springboot.springaop.MyOperationLog;
import com.distributeredis.redis_springboot.springaop.impl.LogServiceImpl;
import com.distributeredis.redis_springboot.springaop.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("aop")
public class TestAop {
    public TestAop() {}
    @Autowired
    private LogServiceImpl logService;

    @PostMapping("/test")
    @MyOperationLog(methodName = "testLog",currentUser = "admin",operate = "查询")
    public String testAop(@RequestBody User user) {
        String test = logService.logTest(user);
        return test;
    }

    @PostMapping("/test2")
    public String testAop2(@RequestParam("school") String school, @RequestParam("address") String address) {
        String test = logService.logTest2(school,address);
        return test;
    }

    @PostMapping("/test3")
    public String testAop3(@RequestParam("school") String school, @RequestParam("address") String address) {
        String test = logService.logTest2(school,address);
        return test;
    }
}
